package org.example.service.workItem;

import com.baomidou.mybatisplus.extension.service.IService;
import org.example.model.common.PageResponseDto;
import org.example.model.common.ResponseResult;
import org.example.model.workItem.dtos.WorkItemDto;
import org.example.model.workItem.entities.WorkItem;
import org.example.model.workItem.vos.ModifyWorkItemVo;
import org.example.model.workItem.vos.SearchWorkItemVo;

import java.util.List;

/**
 * 工作项服务层接口
 */
public interface WorkItemService extends IService<WorkItem> {

    /**
     * 添加一条工作项
     */
    ResponseResult<Boolean> InsertWorkItem(ModifyWorkItemVo modifyWorkItemVo);

    /**
     * 根据id修改一条工作项
     */
    ResponseResult<Boolean> UpdateWorkItemById(ModifyWorkItemVo modifyWorkItemVo);

    /**
     * 根据条件分页获取工作项列表
     */
    ResponseResult<PageResponseDto<List<WorkItemDto>>> SelectWorkItemByPage(SearchWorkItemVo searchWorkItemVo);

    /**
     * 根据id删除一条工作项
     */
    ResponseResult<Boolean> DeleteWorkItemById(Integer id);

    /**
     * 根据项目id获取当前项目的总用时
     */
    double GetProjectTimeSpentByProjectId(Integer projectId);

}
